package cn.hellohao.dao;

import cn.hellohao.pojo.ImgData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ImgApiMapper {
    @Select("SELECT id,imgname,imgurl,sizes,source FROM imgdata where userid = 1 ORDER BY RAND() LIMIT 20")
    public List<ImgData> selectAllImgs();

    @Select("SELECT id,imgname,imgurl,sizes,source FROM imgdata WHERE id > #{id} LIMIT 20")
    public List<ImgData> selectDetail(int id);

    @Select("SELECT id,imgname,imgurl,sizes,source FROM imgdata WHERE id = #{id}")
    public ImgData selectTc(int id);
}
